fix sendFiles maxConcurrent - #1716
Conversation
📝 WalkthroughWalkthrough
ChangesUpload concurrency
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant RocketRideCLI
participant RocketRideClient
participant UploadPipe
RocketRideCLI->>RocketRideClient: sendFiles(files, token, maxConcurrent)
RocketRideClient->>UploadPipe: start up to maxConcurrent uploads
UploadPipe-->>RocketRideClient: complete each upload
RocketRideClient-->>RocketRideCLI: return ordered results
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete. |
1f11ac8 to
af599b8
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/client-typescript/src/client/client.ts`:
- Around line 1374-1378: Validate maxConcurrent with Number.isFinite before
calculating concurrency in sendFiles, rejecting non-finite values such as NaN
and Infinity. Preserve the existing minimum-concurrency behavior for finite
inputs and ensure invalid values cannot create a zero-worker upload path or
sparse results.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 0e6d24a5-8888-4036-8b8c-ef9cfa90015b
📒 Files selected for processing (4)
packages/client-typescript/src/cli/rocketride.tspackages/client-typescript/src/client/client.tspackages/client-typescript/tests/RocketRideClient.test.tspackages/shell-api/versions/v0.d.ts
af599b8 to
4799998
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/client-typescript/src/cli/rocketride.ts`:
- Line 1455: Validate the max-concurrent CLI value before creating or connecting
the pipeline: parse it with Number(), reject non-finite values early, and return
through the existing CLI error path before invoking use() or sendFiles(). Keep
the client-side validation in sendFiles() as a defense in depth, and update the
sendFiles call in the surrounding command flow to use the validated value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9309deda-449d-418a-8828-ee3220b99241
📒 Files selected for processing (4)
packages/client-typescript/src/cli/rocketride.tspackages/client-typescript/src/client/client.tspackages/client-typescript/tests/RocketRideClient.test.tspackages/shell-api/versions/v0.d.ts
4799998 to
16f2274
Compare
fixes #1381
changes:
maxConcurrentargument to TypeScriptsendFilesmaxConcurrentvalues in both the CLI path and client API before calculating worker count--max-concurrentoption through tosendFilesCodeRabbit:
maxConcurrentclient thread with aNumber.isFiniteguard and regression forNumber.NaN--max-concurrentbefore any connection or pipeline creationverification:
git diff --checkpnpm install --frozen-lockfile(completed with existing missingrocketridebin symlink warnings)pnpm exec jest tests/RocketRideClient.test.ts --runInBand -t "sendFiles concurrency"frompackages/client-typescript-> 2 passed, 60 skipped; warned that the local RocketRide server was unavailable for unrelated integration testspnpm exec tsc -p tsconfig.json --noEmitfrompackages/client-typescriptpnpm exec tsc -p tsconfig.cli.json --noEmitfrompackages/client-typescriptgitleaksnotes:
Summary by CodeRabbit
maxConcurrent, defaulting to 5).maxConcurrenthandling.